home *** CD-ROM | disk | FTP | other *** search
/ Power CD / Power CD ATARI-Rechner Lieben.iso / FALCON / JPEGV214 / JPEGV214.TXT < prev   
Encoding:
Text File  |  1993-11-07  |  13.6 KB  |  336 lines

  1.                            The V11 JFIF viewer
  2.                           for the Atari Falcon
  3.  
  4.                     030-only version 2.14, 7/11/93.
  5.  
  6.         By David R. Oldcorn of Volume 11 Software Development
  7.    All Falcon-specific parts (c) 1993 Volume 11 Software/DR Oldcorn.
  8.       Based on the JFIF C conversion software originally by the
  9.                       Independent JPEG Group.
  10.  
  11.        DSP56001 code and interface written 23/7/93 - 28/7/93
  12.                           (not included)
  13.  
  14.  GIF and Graphics Interchange Format are trademarks of Compuserve, Inc.
  15.  
  16.  
  17.  
  18.  
  19. Usage:
  20.  
  21. About the easiest setup is to set it on a function key and as a
  22. JPG extension triggered system, so double-clicking a JPG file will
  23. show it onscreen, and an F-key will bring up the viewer.
  24.  
  25. Once it is running the controls are as follows:
  26.  
  27. File selection screen:
  28. A-Z:       select drive to be displayed.
  29. Cursors:   move file cursor
  30. RETURN:    show file / enter subdirectory
  31. BACKSPACE: exit subdirectory
  32. *:         show info on current file
  33. Esc:       exit to desktop
  34. Space:     mark file for slideshow
  35. Tab:       start slideshow (show all if no files selected)
  36. Insert:    switch to preferences screen
  37. Help:      show keylist & program info
  38.  
  39.  
  40. In display mode:
  41. Cursors:   move screen
  42. Esc:       exit now
  43. Return:    exit / next slideshow file
  44. Space:     halfsize picture
  45. Backspace: switch interlaced frame alternacy (not enormously useful)
  46.  
  47.  
  48. On preferences screen:
  49. Cursors:  move cursor / alter contrast settings
  50. Space:    change status
  51. Shift+Curs: +- 10 to contrast settings
  52. Return/Esc/Insert: exit
  53.  
  54.  
  55. This 030 version is entirely public domain, and you are free to distribute
  56. it as much as you like AS LONG AS it and this file are NOT ALTERED in
  57. ANY way, and that it is always accompanied by this file.
  58.  
  59. The full DSP version of this software is available for £5 from:
  60.              Volume 11 Software Development,
  61.              PO Box 311,
  62.              Broughton
  63.              Preston
  64.              PR3 5DZ
  65.              (England)
  66.  
  67. All monies should be made payable to D. Oldcorn.
  68.  
  69. Note that the DSP version is not at all public domain in any way, shape
  70. or form and may not be copied for distribution.
  71.  
  72. I can be contacted until at least August 1994 on email at:
  73. oldcornd@cs.man.ac.uk
  74.  
  75. All feedback, suggestions and comments welcome.
  76.  
  77.  
  78.  
  79.  
  80. GENERAL NOTES
  81.  
  82. All pictures are displayed in standard Falcon 16-bit Truecolour.
  83. Although, to tell the truth, 1 part in 64 of green really makes
  84. very little difference. Even the ST formats (Degas etc.) are run in TC
  85. mode, so all the halfsize features still work.
  86.  
  87. Working memory is 2x size of the loaded file + about 50K + size of the
  88. selected image buffer.
  89.        For 384x240, this will be around 0.5 Meg
  90.        For 768x480, this will be around 1.5 Megs.
  91. For VERY large pictures operating in hardware scroll mode can require
  92. around 2.5-3 Megs (think about it... that's a 1.9 Meg display area,
  93. plus the fact that the data is likely to be a bit on the big side....)
  94. It won't work with less than 4 megs except on very small pictures.
  95. GIF conversions may require MORE memory than JFIF's due to the
  96. larger files. They usually take longer, too.
  97. If you get an 'out of memory' error, set a lower res video mode and
  98. turn hardware scroll off and/or set halfsize on - this will
  99. limit the screen size by not allocating memory for areas outside
  100. the left and right of the visible screen area (it WILL still allocate
  101. for VERTICAL scroll but if halfsize is on this is unlikely to be
  102. necessary).
  103.  
  104. It has displayed JPEGs as big as 640x2500 and 1700x1700 (halfsized).
  105.  
  106. In slideshow mode, remember it has to hold TWO pictures in memory at
  107. once... so you won't be able to show big pictures one after
  108. another without running out of memory. That said, if you're running
  109. it in a clear Falcon with just the Control Panel installed, you
  110. should have about 3.8 megs free, so the pics will have to be pretty
  111. huge to cause problems (I've found that two 1024x768's is about
  112. big enough to do it).
  113.  
  114. Due to a slightly unhinged design flaw in the Falcon video XBIOS
  115. (which was always present on the ST too, but because direct hardware
  116. accesses were OK you could get round it) the screen resolution can't
  117. be changed without clearing the screen (to white, of all things) which
  118. 1) leads to the flicker when an image starts loading, 2) leads to
  119. flickering and unusual output when the slideshow swaps an image,
  120. especially if it has to change resolutions.
  121. (I think this actually goes against Atari's own Falcon specifications
  122. which says 'Vsetmode does not initialise the VDI etc.')
  123.  
  124. VGA mode is limited to 320x240 because the Falcon doesn't support
  125. 640-wide screen modes in VGA Truecolour. The hardware scroll and
  126. halfsize should still be OK so you WILL be able to see a full picture.
  127. All VGA modes are currently untested, because I don't have a VGA monitor!
  128.  
  129. Full PAL height uses direct access to the video hardware to remove the
  130. top and bottom borders produced when using overscan on a PAL (50Hz)
  131. TV or monitor.
  132. If when you select this mode your monitor does ANYTHING strange
  133. (minor distortion on the top couple of lines is OK) like not syncing
  134. properly (a rolling screen), then don't use it (most likely you will
  135. have some, as yet unknown, future version of the Falcon video system).
  136. This produces the maximum 600 data lines, although you'll probably need
  137. a vertical resize to see the top 30 and bottom 10 of these.
  138.  
  139. The STe hardware scroll registers are also used for pictures which
  140. are wider than the screen. These should be valid on all Falcons, but
  141. an option is given to disable horizontal scrolling, in which case the
  142. hardware register will not be accessed. If hardware scrolling is active,
  143. out of memory messages will not appear correctly due to the operating
  144. system not having been configured for the hardware register control.
  145.  
  146. Another hardware access is made, to set the border colour (if
  147. visible) to black
  148.  
  149. All of these accesses can be disabled with an option, which will prevent
  150. any possibility of any illegal hardware access.
  151.  
  152. It pings when it's finished loading whatever it's loading, and usually
  153. when it runs out of memory.
  154.  
  155. Using it under MultiTOS is a Real Bad Idea but it is quite legal in memory
  156. usage and management. Running this under MultiTOS would be like
  157. putting the Williams Renault engine in a Robin Reliant - completely
  158. pointless. (As far as I can tell, the incompatibility is caused by
  159. changing screen res + direct screen access: although this program
  160. could manage without res changes, if it used the VDI it'd take weeks...
  161. currently plotting one pixel takes 9 instructions in YCrCb...)
  162. (P.S. The reason it doesn't work is it kills the AES process which is
  163. invariably very very fatal).
  164.  
  165. Error messages will not be printed unless using 'info' on a file.
  166.  
  167.  
  168.  
  169. GENERAL NOTES ON JFIF CONVERTER.
  170.  
  171. Current version implements a subset of JFIF.
  172. BUT most standard JFIF's will certainly be supported, if they
  173. have been compacted using a range of standard parameters.
  174.  
  175. It will only handle images in YCrCb and greyscale (the only two
  176. colourspaces for general use).
  177. Noninterleaved scans are not supported. (These are currently rare).
  178. A couple of VERY strange sampling ratios may produce unusual output:
  179. anything mixing 3's and 2's or 4's and 3's may do it...
  180. 3x1 2x1 1x1, 1x4 1x3 1x1... something like that (anything which
  181. produces non-integral upsampling ratios).
  182.  
  183. This should include the vast majority of JFIF files.
  184. (This covers ALL the JPEGs I have encountered, and all those which can be
  185. created using the Independent JPEG group's CJPEG software).
  186.  
  187. It is recommended that ALL stored JPEGS should be 2x2 1x1 1x1 (as
  188. recommended in the JFIF standard), other ratios will produce
  189. insignificant improvements whilst increasing the size of the file!
  190.  
  191. Error checking is performed to a limited extent, but faulty files will
  192. (most likely) halt the decompacter or produce horrible data. Resyncing
  193. is NOT guaranteed even if restart markers are included, but in most
  194. cases some kind of resync should be possible. It won't necessarily be
  195. in the right place for the output stages!
  196.  
  197. Halfsize reduction is performed by a supersampled zoom at the
  198. upsampling stage (only approximately if you are using non-1x1/2x2
  199. ratios, but this should be fairly rare).
  200.  
  201.  
  202. NOTES ON DSP CODE:
  203.  
  204. The DSP version is slightly more limited than the plain vanilla
  205. 030 version, due to the limited memory available to the DSP and the
  206. logistics involved in programming a fast, efficient DSP version. As
  207. a result, some JPEGs will have be processed by the 030 entropy decode
  208. rather than the DSP, which will be slower. Notably, anything with
  209. restart markers will have to be done on the 030, and anything with
  210. silly sampling ratios (CrCb ratios must be 1x1 1x1 to be OK, and Y must
  211. be 1x1, 2x2, 2x1 or 1x2 - i.e. all the normal ones).
  212. The DSP version completely ignores any detected errors in the input
  213. file (e.g. corruption leading to invalid Huffman table entries being
  214. referenced), but this will usually cause major image corruption anyway.
  215. On average it runs about 3 times faster than a pure 030 scan.
  216. If a full DSP scan can't be done, and the DSP is  available, it will
  217. use DSP iDCT and 030 Huffman, which will run about half of full DSP
  218. speed.
  219. All properly written DSP programs should run OK after the JPEG process
  220. has terminated.
  221.  
  222.  
  223.  
  224. NOTES ON GIF CONVERTER
  225.  
  226. Interleaved scans are not currently supported, because I haven't got
  227. any interlaced GIF's!
  228. If no colour map is present it will do something silly.
  229. Halfsize reduction and cutdown are not supported (i.e. hardware scroll
  230. mode only for images bigger than the screen).
  231. It's bloody slow, but that's LZW for you.
  232.  
  233.  
  234.  
  235.  
  236. Known bugs:
  237.   Greyscale files can sometimes refuse to decompress on DSP properly when
  238.   the viewer is first loaded into a clear Falcon. Decompressing a colour
  239.   JPEG first will fix this. I am investigating the problem.
  240.  
  241.   When viewing large pictures, the hardware scroll registers can be
  242.   set wrongly by the viewer if the image is more than 1024 pixels wider
  243.   than the screen resolution, resulting in a corrupted display. Usually
  244.   this only happens if viewing a big picture in reduced resolutions.
  245.  
  246.   If it is really badly out of memory in slideshow mode it will do some
  247.   very strange and unpredictable things. Usually hitting 'RETURN' a lot
  248.   will wake it up.
  249.  
  250.   A strange error somewhere in the maths can cause it to distort blocks -
  251.   this bug is very rare and almost impossible to simulate in tests, but
  252.   investigation is under way. It may be due to a corrupted JPEG file with
  253.   poor pickup of restart markers. So far I haven't seen it on a pic without
  254.   restarts.
  255.  
  256.   Still might be a bit of a bug with the halfsizer, although I'm blown if
  257.   I can find it.
  258.  
  259.  
  260. Possibly coming in future versions:
  261.  
  262.   More pic formats - Targa under development, possibly TIFF and RAW.
  263.   Save preferences, if problems with finding the preference file can be
  264.   fixed.
  265.  
  266.  
  267. Code History:
  268.  
  269.  2.14: Preferences changes, and switch to assemble 030-only version. File
  270.  sizes now shown. GIF bugs fixed. PAL600 fixed for TV's that have fiddly
  271.  syncpulse requirements. Screen scroll system fixed properly. DSP lock
  272.  and error detection now reported to options screen. Upsampler reworked
  273.  to allow halfsizing of all JPEG's. Halfsize bug fixed (sort of). Enabled
  274.  a key to swap frame alternacy to occasionally improve display of some
  275.  JPEGs. Contrast expansion added. Not happy with the control system for it.
  276.  
  277.  2.13: Added other file format handling: Degas, Spectrum 512 (you
  278.  won't BELIEVE how much fiddling this routine's been through, since
  279.  I had to manually tune it - and a stupid bug didn't help!). Fixed memory
  280.  allocate to only allocate on 4-byte boundaries beacuse otherwise
  281.  the video system complains, sometimes stridently.
  282.  
  283.  2.12: Fixed a series of bugs in MCU transform and upsampler to get more
  284.  sampling ratios working properly. Improved GIF converter a bit. Added
  285.  SOF1 marker to let low-quality sampled images work properly. Added
  286.  'slideshow all' mode if no files are marked. Switched over to 16-bit
  287.  Truecolour, but can't see the difference, so I dunno whether it works!
  288.  
  289.  2.11: Fixed PAL600 bug caused by manky video programming. Introduced
  290.  Info. Introduced source history. Which is why it doesn't go too far back!
  291.  
  292.  2.10: Added slideshow mode, including view-and-decompress any pic,
  293.  including major rewrites to all the video code. Code rearranged into
  294.  logical sections (select/view & scan, JPEG, GIF).
  295.  Added no-hardware access mode. Fixed some minor bugs with selector.
  296.  Rewrote DSP output transform to fix some more sample ratios for DSP.
  297.  
  298.  2.09: Rewrote upsampler for more than just 2x2/1x1 sample ratios.
  299.  Went over to DSP code 2.01, and rewrote IDCT-on-DSP output transform
  300.  accordingly. Moved big non-initialised data to BSS segment.
  301.  
  302.  
  303. DSP code history:
  304.  
  305.  2.01: All coefficient output converted to be range-limited. Some speed
  306.  modifications made.
  307.  2.00: Huffman/IDCT on DSP.
  308.  1.0: IDCT on DSP.
  309.  
  310.  
  311.  
  312.  
  313.  
  314. Rough Execution times for 640x480 colour JPEG:
  315. 030 version: 15 seconds
  316. DSP version: 6 seconds
  317.  
  318. Currently supported file formats:
  319.  
  320. JPG - Jpeg File Interchange Format
  321. GIF - CompuServe GIF (TM)
  322. PI? - DEGAS uncompressed
  323. PC? - DEGAS compressed
  324. SPC - Spectrum 512 compressed
  325.  
  326.  
  327.  
  328. Regular updates should be available - when I either think of new ideas,
  329. or manage to find a new JPEG it won't handle!
  330.  
  331. Coming soon: Starball, an ST / Falcon Pinball game, which is completely
  332. awesome, in every respect. Falcon features include 50 frames per second
  333. operation and stereo soundtracker sound. Even on the ST it'll blow your
  334. socks off. Believe it!
  335.  
  336. ə